package com.ruoyi.system.service.impl;

import java.security.Timestamp;
import java.util.Date;
import java.util.List;

import com.sun.jna.platform.win32.Sspi;
import net.sf.jsqlparser.expression.DateTimeLiteralExpression;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysOutletInventoryMapper;
import com.ruoyi.system.domain.SysOutletInventory;
import com.ruoyi.system.service.ISysOutletInventoryService;

/**
 * 网点库存Service业务层处理
 *
 * @author ruoyi
 * @date 2024-07-23
 */
@Service
public class SysOutletInventoryServiceImpl implements ISysOutletInventoryService
{
    @Autowired
    private SysOutletInventoryMapper sysOutletInventoryMapper;

    /**
     * 查询网点库存
     *
     * @param oId 网点库存主键
     * @return 网点库存
     */
    @Override
    public SysOutletInventory selectSysOutletInventoryByOId(Long oId)
    {
        return sysOutletInventoryMapper.selectSysOutletInventoryByOId(oId);
    }

    /**
     * 查询网点库存列表
     *
     * @param sysOutletInventory 网点库存
     * @return 网点库存
     */
    @Override
    public List<SysOutletInventory> selectSysOutletInventoryList(SysOutletInventory sysOutletInventory)
    {
        return sysOutletInventoryMapper.selectSysOutletInventoryList(sysOutletInventory);
    }

    /**
     * 新增网点库存
     *
     * @param sysOutletInventory 网点库存
     * @return 结果
     */
    @Override
    public int insertSysOutletInventory(SysOutletInventory sysOutletInventory)
    {
        sysOutletInventory.setBatchNum(Long.toString(new Date().getTime()));
        return sysOutletInventoryMapper.insertSysOutletInventory(sysOutletInventory);
    }

    /**
     * 修改网点库存
     *
     * @param sysOutletInventory 网点库存
     * @return 结果
     */
    @Override
    public int updateSysOutletInventory(SysOutletInventory sysOutletInventory)
    {
        return sysOutletInventoryMapper.updateSysOutletInventory(sysOutletInventory);
    }

    /**
     * 批量删除网点库存
     *
     * @param oIds 需要删除的网点库存主键
     * @return 结果
     */
    @Override
    public int deleteSysOutletInventoryByOIds(Long[] oIds)
    {
        return sysOutletInventoryMapper.deleteSysOutletInventoryByOIds(oIds);
    }

    /**
     * 删除网点库存信息
     *
     * @param oId 网点库存主键
     * @return 结果
     */
    @Override
    public int deleteSysOutletInventoryByOId(Long oId)
    {
        return sysOutletInventoryMapper.deleteSysOutletInventoryByOId(oId);
    }
}
